//--------------------------------------------------------------------------------------------: 
//      Component name  : unpackfp
//      Author          : 
//      Company         : 
//
//      Description     : 
//
//
//--------------------------------------------------------------------------------------------


module UnpackFP(FP, SIG, EXP, SIGN, isNaN, isINF, isZ, isDN);
   input [31:0]  FP;
   output [31:0] SIG;
   output [7:0]  EXP;
   output        SIGN;
   output        isNaN;
   output        isINF;
   output        isZ;
   output        isDN;
   
   wire [7:0]    exp_int;
   wire [22:0]   sig_int;
   wire          expZ;
   wire          expFF;
   wire          sigZ;
   assign exp_int = FP[30:23];
   assign sig_int = FP[22:0];
   
   assign SIGN = FP[31];
   assign EXP = exp_int;
   assign SIG[22:0] = sig_int;
   
   assign expZ = ((exp_int == 8'h00)) ? 1'b1 : 
                 1'b0;
   assign expFF = ((exp_int == 8'hFF)) ? 1'b1 : 
                  1'b0;
   
   assign sigZ = ((sig_int == 23'b00000000000000000000000)) ? 1'b1 : 
                 1'b0;
   
   assign isNaN = expFF & ((~sigZ));
   assign isINF = expFF & sigZ;
   assign isZ = expZ & sigZ;
   assign isDN = expZ & ((~sigZ));
   
   assign SIG[23] = (~expZ);
   
   assign SIG[31:24] = {32{1'b0}};
   
endmodule
